describe('User routes', ()->
    location=null;
    beforeEach(()->
        location= document.location.pathname
    )
    afterEach(()->
        Backbone.history.navigate(location)
        Backbone.history.stop();
    );
    it('should by CreateUser route', ()->
        spyOn(AdminUserRoutes.prototype, "Create")
        router = new AdminUserRoutes();
        Backbone.history.start({silent: true, pushState: true});
        router.navigate("Users/Create", true)
        expect(AdminUserRoutes.prototype.Create).toHaveBeenCalled()

        return
    );
    it('should by EditUser route', ()->
        spyOn(AdminUserRoutes.prototype, "Edit")
        router = new AdminUserRoutes();
        Backbone.history.start({silent: true, pushState: true});
        router.navigate("Users/Edit?userId=1", true)
        expect(AdminUserRoutes.prototype.Edit).toHaveBeenCalledWith("?userId=1")

        return
    );

    it('should by ListinUser route', ()->
        spyOn(AdminUserRoutes.prototype, "Listing")
        router = new AdminUserRoutes();
        Backbone.history.start({silent: true, pushState: true});
        router.navigate("Users", true)
        expect(AdminUserRoutes.prototype.Listing).toHaveBeenCalled()

        router.navigate("Users/Index", true)
        expect(AdminUserRoutes.prototype.Listing).toHaveBeenCalled()

        router.navigate("Users/Listing", true)
        expect(AdminUserRoutes.prototype.Listing).toHaveBeenCalled()

        router.navigate("Users/Listing?column=1", true)
        expect(AdminUserRoutes.prototype.Listing).toHaveBeenCalled()

        return
    );
);